.class public Lcom/instagram/android/directshare/widget/i;
.super Lcom/instagram/ui/c/b;
.source "DirectShareUserListAdapter.java"

# interfaces
.implements Landroid/widget/Filterable;


# annotations
.annotation system Ldalvik/annotation/Signature;
    value = {
        "Lcom/instagram/ui/c/b",
        "<",
        "Lcom/instagram/android/model/b/e;",
        ">;",
        "Landroid/widget/Filterable;"
    }
.end annotation


# instance fields
.field private final a:Lcom/instagram/android/directshare/widget/j;

.field private b:Lcom/instagram/pendingmedia/model/c;

.field private c:Lcom/instagram/android/directshare/widget/k;

.field private d:Landroid/widget/Filter;

.field private e:Z

.field private f:Z


# direct methods
.method public constructor <init>(Landroid/content/Context;Lcom/instagram/android/directshare/widget/j;)V
    .locals 0
    .parameter
    .parameter

    .prologue
    .line 55
    invoke-direct {p0, p1}, Lcom/instagram/ui/c/b;-><init>(Landroid/content/Context;)V

    .line 56
    iput-object p2, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    .line 57
    return-void
.end method

.method private e()I
    .locals 1

    .prologue
    .line 153
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->X()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 154
    const/4 v0, -0x1

    .line 156
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method private e(I)I
    .locals 2
    .parameter

    .prologue
    .line 203
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->X()Z

    move-result v0

    if-nez v0, :cond_0

    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->Z()Z

    move-result v0

    if-nez v0, :cond_0

    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->e()I

    move-result v0

    if-le p1, v0, :cond_1

    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->g()I

    move-result v0

    if-ge p1, v0, :cond_1

    .line 207
    :cond_0
    add-int/lit8 v0, p1, -0x1

    .line 209
    :goto_0
    return v0

    .line 208
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->g()I

    move-result v0

    if-le p1, v0, :cond_2

    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->getCount()I

    move-result v0

    if-ge p1, v0, :cond_2

    .line 209
    add-int/lit8 v0, p1, -0x2

    goto :goto_0

    .line 211
    :cond_2
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    const-string v1, "Cannot adjust for headers."

    invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V

    throw v0
.end method

.method private g()I
    .locals 1

    .prologue
    .line 160
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->Z()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 161
    const/4 v0, -0x1

    .line 167
    :goto_0
    return v0

    .line 164
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->X()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 165
    const/4 v0, 0x0

    goto :goto_0

    .line 167
    :cond_1
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->Y()I

    move-result v0

    add-int/lit8 v0, v0, 0x1

    goto :goto_0
.end method

.method private h()I
    .locals 2

    .prologue
    .line 237
    const/4 v0, 0x0

    .line 238
    iget-object v1, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v1}, Lcom/instagram/android/directshare/widget/j;->X()Z

    move-result v1

    if-nez v1, :cond_0

    .line 239
    const/4 v0, 0x1

    .line 241
    :cond_0
    iget-object v1, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v1}, Lcom/instagram/android/directshare/widget/j;->Z()Z

    move-result v1

    if-nez v1, :cond_1

    .line 242
    add-int/lit8 v0, v0, 0x1

    .line 244
    :cond_1
    return v0
.end method


# virtual methods
.method public a(I)I
    .locals 1
    .parameter

    .prologue
    .line 133
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 134
    const/4 v0, 0x1

    .line 136
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method protected a()Landroid/view/View;
    .locals 3

    .prologue
    .line 222
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->f()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    sget v1, Lcom/facebook/ax;->directshare_row_no_results:I

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object v1

    .line 224
    sget v0, Lcom/facebook/aw;->row_no_results_textview:I

    invoke-virtual {v1, v0}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v0

    check-cast v0, Landroid/widget/TextView;

    sget v2, Lcom/facebook/ba;->no_users_found:I

    invoke-virtual {v0, v2}, Landroid/widget/TextView;->setText(I)V

    .line 225
    return-object v1
.end method

.method protected a(Landroid/content/Context;ILandroid/view/ViewGroup;)Landroid/view/View;
    .locals 2
    .parameter
    .parameter
    .parameter

    .prologue
    .line 81
    invoke-virtual {p0, p2}, Lcom/instagram/android/directshare/widget/i;->getItemViewType(I)I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 95
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    const-string v1, "Unhandled view type"

    invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 83
    :pswitch_0
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->b()Lcom/instagram/android/directshare/widget/k;

    move-result-object v0

    invoke-virtual {v0, p1}, Lcom/instagram/android/directshare/widget/k;->a(Landroid/content/Context;)Landroid/view/View;

    move-result-object v0

    .line 91
    :goto_0
    return-object v0

    .line 85
    :pswitch_1
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->a()Landroid/view/View;

    move-result-object v0

    goto :goto_0

    .line 87
    :pswitch_2
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->b()Lcom/instagram/android/directshare/widget/k;

    move-result-object v0

    sget v1, Lcom/facebook/ba;->directshare_user_list_header_suggestions:I

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Lcom/instagram/android/directshare/widget/k;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/view/View;

    move-result-object v0

    goto :goto_0

    .line 91
    :pswitch_3
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->b()Lcom/instagram/android/directshare/widget/k;

    move-result-object v0

    sget v1, Lcom/facebook/ba;->directshare_user_list_header_following:I

    invoke-virtual {p1, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v0, p1, v1}, Lcom/instagram/android/directshare/widget/k;->a(Landroid/content/Context;Ljava/lang/String;)Landroid/view/View;

    move-result-object v0

    goto :goto_0

    .line 81
    nop

    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_2
        :pswitch_3
    .end packed-switch
.end method

.method protected a(Landroid/view/View;Landroid/content/Context;I)V
    .locals 5
    .parameter
    .parameter
    .parameter

    .prologue
    .line 101
    invoke-virtual {p0, p3}, Lcom/instagram/android/directshare/widget/i;->getItemViewType(I)I

    move-result v0

    packed-switch v0, :pswitch_data_0

    .line 115
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    const-string v1, "Unhandled view type"

    invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 103
    :pswitch_0
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->b()Lcom/instagram/android/directshare/widget/k;

    move-result-object v2

    invoke-virtual {p1}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/directshare/widget/l;

    invoke-virtual {p0, p3}, Lcom/instagram/android/directshare/widget/i;->d(I)Lcom/instagram/android/model/b/e;

    move-result-object v3

    iget-object v4, p0, Lcom/instagram/android/directshare/widget/i;->b:Lcom/instagram/pendingmedia/model/c;

    iget-boolean v1, p0, Lcom/instagram/android/directshare/widget/i;->f:Z

    if-eqz v1, :cond_0

    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->getCount()I

    move-result v1

    add-int/lit8 v1, v1, -0x1

    if-ne p3, v1, :cond_0

    const/4 v1, 0x1

    :goto_0
    invoke-virtual {v2, v0, v3, v4, v1}, Lcom/instagram/android/directshare/widget/k;->a(Lcom/instagram/android/directshare/widget/l;Lcom/instagram/android/model/b/e;Lcom/instagram/pendingmedia/model/c;Z)V

    .line 117
    :pswitch_1
    return-void

    .line 103
    :cond_0
    const/4 v1, 0x0

    goto :goto_0

    .line 101
    :pswitch_data_0
    .packed-switch 0x0
        :pswitch_0
        :pswitch_1
        :pswitch_1
        :pswitch_1
    .end packed-switch
.end method

.method public a(Lcom/instagram/pendingmedia/model/c;)V
    .locals 0
    .parameter

    .prologue
    .line 60
    iput-object p1, p0, Lcom/instagram/android/directshare/widget/i;->b:Lcom/instagram/pendingmedia/model/c;

    .line 61
    return-void
.end method

.method public a(Z)V
    .locals 0
    .parameter

    .prologue
    .line 268
    iput-boolean p1, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    .line 269
    return-void
.end method

.method public b(I)I
    .locals 1
    .parameter

    .prologue
    .line 141
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 142
    const/4 v0, 0x1

    .line 149
    :goto_0
    return v0

    .line 143
    :cond_0
    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->e()I

    move-result v0

    if-ne p1, v0, :cond_1

    .line 144
    const/4 v0, 0x2

    goto :goto_0

    .line 145
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->g()I

    move-result v0

    if-ne p1, v0, :cond_2

    .line 146
    const/4 v0, 0x3

    goto :goto_0

    .line 149
    :cond_2
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public b()Lcom/instagram/android/directshare/widget/k;
    .locals 1

    .prologue
    .line 261
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->c:Lcom/instagram/android/directshare/widget/k;

    if-nez v0, :cond_0

    .line 262
    new-instance v0, Lcom/instagram/android/directshare/widget/k;

    invoke-direct {v0}, Lcom/instagram/android/directshare/widget/k;-><init>()V

    iput-object v0, p0, Lcom/instagram/android/directshare/widget/i;->c:Lcom/instagram/android/directshare/widget/k;

    .line 264
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->c:Lcom/instagram/android/directshare/widget/k;

    return-object v0
.end method

.method public b(Ljava/util/List;)V
    .locals 1
    .parameter
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/android/model/b/e;",
            ">;)V"
        }
    .end annotation

    .prologue
    .line 280
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_0

    .line 281
    const/4 v0, 0x0

    iput-boolean v0, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    .line 283
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->addAll(Ljava/util/Collection;)Z

    .line 284
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->notifyDataSetChanged()V

    .line 285
    return-void
.end method

.method public b(Z)V
    .locals 0
    .parameter

    .prologue
    .line 272
    iput-boolean p1, p0, Lcom/instagram/android/directshare/widget/i;->f:Z

    .line 273
    return-void
.end method

.method public c()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/android/model/b/e;",
            ">;"
        }
    .end annotation

    .prologue
    .line 276
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-static {v0}, Ljava/util/Collections;->unmodifiableList(Ljava/util/List;)Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public c(I)Z
    .locals 1
    .parameter

    .prologue
    .line 177
    invoke-virtual {p0, p1}, Lcom/instagram/android/directshare/widget/i;->getItemViewType(I)I

    move-result v0

    if-nez v0, :cond_0

    const/4 v0, 0x1

    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method

.method public d(I)Lcom/instagram/android/model/b/e;
    .locals 2
    .parameter

    .prologue
    .line 190
    invoke-virtual {p0, p1}, Lcom/instagram/android/directshare/widget/i;->getItemViewType(I)I

    move-result v0

    if-eqz v0, :cond_0

    .line 191
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    const-string v1, "Cannot getItem() on a header row."

    invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 195
    :cond_0
    iget-boolean v0, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    if-nez v0, :cond_1

    .line 197
    invoke-direct {p0, p1}, Lcom/instagram/android/directshare/widget/i;->e(I)I

    move-result p1

    .line 199
    :cond_1
    invoke-super {p0, p1}, Lcom/instagram/ui/c/b;->getItem(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/instagram/android/model/b/e;

    return-object v0
.end method

.method public d()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List",
            "<",
            "Lcom/instagram/android/model/b/e;",
            ">;"
        }
    .end annotation

    .prologue
    .line 292
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->a:Lcom/instagram/android/directshare/widget/j;

    invoke-interface {v0}, Lcom/instagram/android/directshare/widget/j;->aa()Ljava/util/List;

    move-result-object v0

    return-object v0
.end method

.method public getCount()I
    .locals 2

    .prologue
    .line 66
    iget-boolean v0, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    if-eqz v0, :cond_0

    .line 67
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    .line 76
    :goto_0
    return v0

    .line 71
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 73
    const/4 v0, 0x1

    goto :goto_0

    .line 76
    :cond_1
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->g:Ljava/util/List;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->h()I

    move-result v1

    add-int/2addr v0, v1

    goto :goto_0
.end method

.method public getFilter()Landroid/widget/Filter;
    .locals 1

    .prologue
    .line 230
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->d:Landroid/widget/Filter;

    if-nez v0, :cond_0

    .line 231
    new-instance v0, Lcom/instagram/android/directshare/widget/h;

    invoke-direct {v0, p0}, Lcom/instagram/android/directshare/widget/h;-><init>(Lcom/instagram/android/directshare/widget/i;)V

    iput-object v0, p0, Lcom/instagram/android/directshare/widget/i;->d:Landroid/widget/Filter;

    .line 233
    :cond_0
    iget-object v0, p0, Lcom/instagram/android/directshare/widget/i;->d:Landroid/widget/Filter;

    return-object v0
.end method

.method public synthetic getItem(I)Ljava/lang/Object;
    .locals 1
    .parameter "x0"

    .prologue
    .line 28
    invoke-virtual {p0, p1}, Lcom/instagram/android/directshare/widget/i;->d(I)Lcom/instagram/android/model/b/e;

    move-result-object v0

    return-object v0
.end method

.method public getItemViewType(I)I
    .locals 2
    .parameter "position"

    .prologue
    .line 121
    invoke-virtual {p0}, Lcom/instagram/android/directshare/widget/i;->getCount()I

    move-result v0

    if-lt p1, v0, :cond_0

    .line 122
    new-instance v0, Ljava/lang/IndexOutOfBoundsException;

    const-string v1, "Unsupported item view type"

    invoke-direct {v0, v1}, Ljava/lang/IndexOutOfBoundsException;-><init>(Ljava/lang/String;)V

    throw v0

    .line 125
    :cond_0
    iget-boolean v0, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    if-eqz v0, :cond_1

    .line 126
    invoke-virtual {p0, p1}, Lcom/instagram/android/directshare/widget/i;->a(I)I

    move-result v0

    .line 128
    :goto_0
    return v0

    :cond_1
    invoke-virtual {p0, p1}, Lcom/instagram/android/directshare/widget/i;->b(I)I

    move-result v0

    goto :goto_0
.end method

.method public getViewTypeCount()I
    .locals 1

    .prologue
    .line 217
    const/4 v0, 0x4

    return v0
.end method

.method public isEnabled(I)Z
    .locals 2
    .parameter "position"

    .prologue
    const/4 v0, 0x1

    .line 249
    iget-boolean v1, p0, Lcom/instagram/android/directshare/widget/i;->e:Z

    if-eqz v1, :cond_1

    .line 257
    :cond_0
    :goto_0
    return v0

    .line 253
    :cond_1
    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->e()I

    move-result v1

    if-eq p1, v1, :cond_2

    invoke-direct {p0}, Lcom/instagram/android/directshare/widget/i;->g()I

    move-result v1

    if-ne p1, v1, :cond_0

    .line 255
    :cond_2
    const/4 v0, 0x0

    goto :goto_0
.end method
